<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('labor_team_contracts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('admin_id')->default(0)->index();
            $table->unsignedBigInteger('company_id')->default(0)->index();
            $table->unsignedBigInteger('labor_company_id')->default(0)->index();
            $table->unsignedBigInteger('role_id')->default(0)->index();
            $table->unsignedBigInteger('labor_team_id')->default(0)->index();
            $table->string('contract_type')->nullable()->comment('班组合同类别');
            $table->string('classified_budget_amount')->nullable()->comment('分类预算金额');
            $table->string('contract_number')->nullable()->comment('劳务合同编号');
            $table->string('cpmpany_number')->nullable()->comment('劳务公司编号');
            $table->string('bank')->nullable()->comment('开户银行');
            $table->string('nummber')->nullable()->comment('劳务班组编号');
            $table->string('contact')->nullable()->comment('劳务班组联系方式');
            $table->string('mothod')->nullable()->comment('承包方式');
            $table->string('contract_price')->nullable()->comment('劳务合同金额');
            $table->string('taxes')->nullable()->comment('税金');
            $table->string('taxation_method')->nullable()->comment('计税方式');
            $table->string('progress_payment_ratio')->nullable()->comment('进度款比例');
            $table->string('settlement_ratio')->nullable()->comment('结算款比例');
            $table->date('signing_date')->nullable()->comment('合同签订日期');
            $table->string('signed_amount_by_category')->nullable()->comment('分类累计签订金额');
            $table->string('contract_name')->nullable()->comment('劳务合同名称');
            $table->string('bank_number')->nullable()->comment('银行账号');
            $table->string('name')->nullable()->comment('劳务班组名称');
            $table->string('management_expense')->nullable()->comment('管理费');
            $table->string('company_name')->nullable()->comment('劳务公司名称');
            $table->decimal('price')->default(0)->comment('合同金额(不含税)');
            $table->string('tax_rate')->nullable()->comment('税率');
            $table->string('prepayment_ratio')->nullable()->comment('预付款比例');
            $table->string('completion_payment_ratio')->nullable()->comment('竣工款比例');
            $table->string('Retention_money_ratio')->nullable()->default(0)->comment('质保金比例');
            $table->string('construction_content')->nullable()->comment('施工内容');
            $table->string('construction_method')->nullable()->comment('施工方式');
            $table->string('breach_of_contract')->nullable()->comment('违约责任');
            $table->string('contract_status')->nullable()->comment('合同签署状态');
            $table->string('remarks')->nullable()->comment('备注');
            $table->string('files')->nullable()->comment('附件上传');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('labor_team_contracts');
    }
};
